﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ERP_RORZE_TOOL.Common;
using ERP_RORZE_TOOL.Common.ValueObject;
using ERP_RORZE_TOOL.Tool.BCThoigianlamviecthang;

namespace ERP_RORZE_TOOL.Tool.BCThoigianlamviecthang
{
    class ReportDAO : BaseDAO
	{
		#region Basic Method
        public static DataTable GetAll(string procedure)
		{
            return ExcuteProcedure(procedure);
		}

        public static DataTable GetAll(string procedure, int range)
		{
            try
            {
                var parameters = new SqlParameter[]
                    {
						CreateParameter("@Range", SqlDbType.Int, range)
                    };
                return ExcuteProcedure(procedure, parameters);

            }
            catch (Exception e)
            {
                throw new MyException(e);
            }
		}

        public static DataTable GetAllWithTempTable(string procedure, string tempTableName)
		{
            return ExcuteProcedureWithTempTable(procedure, tempTableName);
		}

        public static DataSet GetAllDS(string procedure)
		{
            return ExcuteProcedureDS(procedure);
		}

		#endregion
	}
}
